<?php

namespace App\Http\Controllers\App;

use App\Http\Controllers\Controller;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Config;
use Overtrue\EasySms\EasySms;
use Overtrue\EasySms\Exceptions\NoGatewayAvailableException;
use App\Jobs\SendEmail;

class IndexController extends Controller
{
    /**
     * Create a new controller instance.
     *
     * @return void
     */
    public function __construct()
    {
        //
        
        
    }
    /**
     * 查询所有
     */
    public function all(Request $request)
    {
        dispatch(new SendEmail());    
        dd('done_--------'.date('Y-m-d H:i:s'));
        /*Redis::setex('site_name', 10, 'Lumen的redis');
        return Redis::get('site_name');*/
        // dd(Crypt::encrypt(123456));
        //dd(Config::get('info.customer_type'));
        /*app('session')->put('key','value23232');
        // 获取session中键值未key的数据
        $re=app('session')->get('key');
        dd($re);*/
        //短信发送
        /*try
        {
            $config = Config::get('info.message_config');
            $easySms = new EasySms($config);

            $re = $easySms->send(17610721570, [
                'content' => '您的验证码${code}，该验证码5分钟内有效，请勿泄漏于他人！',
                'template' => 'SMS_126570108',
                'data' => [
                    'code' => 1234,
                ],
            ]);
            dd($re);
        } catch (NoGatewayAvailableException $e) {
            dd($e->results);
        }*/
        /*$data = array('info' => 'web no auth');
        return $this->respond('get_ok', $data);*/
    }}
